package com.cloud.feeling.ststem.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.netflix.hystrix.contrib.javanica.annotation.DefaultProperties;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;

/**
 * 
  * @Description: 熔断器测试类
  * @author: feelj
  * @date: 2018年10月9日 上午9:36:46 
  *
 */
@RestController
@DefaultProperties(defaultFallback="defaultFallback")
public class HytrixController {
	
	@HystrixCommand
	@GetMapping("/hytrixtest")
	public String hytrixtest() {
		
		return "hello hytrix";
	}
	
	private String fallback() {
		return "太拥挤了，请稍后再试";		
	}
	
	private String defaultFallback() {
		return "太拥挤了，请稍后再试";		
	}

}
